package io.renren.modules.clothingorder.enums;

import lombok.Getter;

/**
 * 订单状态-枚举
 */
@Getter
public enum StatusEnum {
    /**
     * 审核中
     */
    SHENHEZHONG(0,"审核中"),
    /**
     * 报价中
     */
    BAOJIAZHONG(1,"报价中"),
    /**
     * 定制状态
     */
    DINGZHIZHUANGTAI(2,"定制状态"),
    /**
     * 代付款
     */
    DAIFUKUAN(3,"代付款"),
    /**
     * 运输状态
     */
    YUNSHUZHUANGTAI(4,"运输状态"),
    /**
     * 订单完成
     */
    DINGDANWANCHENG(5,"订单完成");

    private Integer index;

    private String value;

    StatusEnum(Integer index,String value){
        this.index = index;
        this.value = value;
    }

    /**
     * 通过index获取value值
     * @param index
     * @return
     */
    public static String getValueByIndex(Integer index) {
        StatusEnum[] values = StatusEnum.values();
        for (StatusEnum value : values) {
            if (value.index.equals(index)) {
                return value.value;
            }
        }
        return null;
    }
}
